{% extends 'base.html' %}

{% block title %}Welcome{% endblock %}

{% block body_id %}front_page{% endblock %}

{% block content %}
{% if object_list %}
    {% for gallery in object_list %}

        <div id="featured_photo">
            <a href="{{ gallery.get_absolute_url }}"><img 
                src="{{ gallery.featured_photo.display.url }}" 
                alt="{{ gallery.featured_photo.title }}"/></a>
            <h2 class="title">{{ gallery.featured_photo.title }}</h2>
            <h2 class="photog">Joe Heinriech</h2>
        </div>

        <br class="clear" />

        <div class="desc">
            <h1>{{ gallery.title }}</h1>
            <div>{{ gallery.featured_photo.caption|linebreaks }}
            </div>
        </div>

        <div class="gallery">
        {% for photo in gallery.sample|slice:":4" %}
        {% ifnotequal photo gallery.featured_photo %}
        <p class="gallery-photo">
            <a href="{{ photo.get_absolute_url }}"><img src="{{ photo.medium.url }}" alt="{{ photo.title }}"/></a>
        </p>
        <h2 class="title">{{ photo.title }}</h2>
        {% endifnotequal %}
        {% endfor %}
        </div>
    {% endfor %}
{% else %}
    <p>No galleries were found.</p>
{% endif %}


{% endblock %}
